Optimal. Leaf size=31 \[ -\frac {(a+b) \cos (c+d x)}{d}+\frac {b \cos ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {3092}
\begin {gather*} \frac {b \cos ^3(c+d x)}{3 d}-\frac {(a+b) \cos (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3092
Rubi steps
\begin {align*} \int \sin (c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx &=-\frac {\text {Subst}\left (\int \left (a+b-b x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {(a+b) \cos (c+d x)}{d}+\frac {b \cos ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 54, normalized size = 1.74 \begin {gather*} -\frac {a \cos (c) \cos (d x)}{d}-\frac {3 b \cos (c+d x)}{4 d}+\frac {b \cos (3 (c+d x))}{12 d}+\frac {a \sin (c) \sin (d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 34, normalized size = 1.10
method | result | size |
derivativedivides | \(\frac {-\frac {b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}-a \cos \left (d x +c \right )}{d}\) | \(34\) |
default | \(\frac {-\frac {b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}-a \cos \left (d x +c \right )}{d}\) | \(34\) |
risch | \(-\frac {\cos \left (d x +c \right ) a}{d}-\frac {3 b \cos \left (d x +c \right )}{4 d}+\frac {\cos \left (3 d x +3 c \right ) b}{12 d}\) | \(41\) |
norman | \(\frac {-\frac {6 a +4 b}{3 d}-\frac {2 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (4 a +4 b \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(70\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 34, normalized size = 1.10 \begin {gather*} \frac {{\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} b - 3 \, a \cos \left (d x + c\right )}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 27, normalized size = 0.87 \begin {gather*} \frac {b \cos \left (d x + c\right )^{3} - 3 \, {\left (a + b\right )} \cos \left (d x + c\right )}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs.
\(2 (26) = 52\).
time = 0.11, size = 58, normalized size = 1.87 \begin {gather*} \begin {cases} - \frac {a \cos {\left (c + d x \right )}}{d} - \frac {b \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 b \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin ^{2}{\left (c \right )}\right ) \sin {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 40, normalized size = 1.29 \begin {gather*} \frac {1}{3} \, {\left (\frac {\cos \left (d x + c\right )^{3}}{d} - \frac {3 \, \cos \left (d x + c\right )}{d}\right )} b - \frac {a \cos \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 13.31, size = 27, normalized size = 0.87 \begin {gather*} \frac {\frac {b\,{\cos \left (c+d\,x\right )}^3}{3}-\cos \left (c+d\,x\right )\,\left (a+b\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________